Dynamic Functions
Users can create PQL formulas from the Content panel by selecting the required functions from the drop down lists. The selected dynamic property is then based on the formula, rather than static values. This provides users with a tremendous amount of flexibility and control over the behavior of dynamic assets.
- The PQL functions for dynamic graphics and text are exposed via the common library and the dynamic library.
How to Build Dynamic PQL Formulas
Select the required function(s) from the drop down menus. Then add the relevant data to the expression simply by selecting it in the grid. For instance, to add a <value_set>, select a set of cells that contain values.
Review the following list to understand how each parameter relates to the grid:
caption |
Click-select a row or column caption (header), or write the caption contained within quotation marks. |
column |
Click a column number from the grid. |
criteria |
Select a row or column caption (header). |
criteria_set |
Write the index of criteria, contained within quotation marks, followed by = and a result. For example (Criteria("Purached Bike"="Yes","Purchased Bike"="No"). |
default_value |
Write a default numeric value. |
if_false |
Write a string, contained within quotation marks. For example, "Up". |
if_true |
Write a string, contained within quotation marks. For example, "Down". |
index |
Click a row or column number. |
isCaseSensitive |
Write either "true" or "false" depending on whether or not the given caption is case sensitive. |
outcome_set |
Write the index of outcomes (the results that should be returned when the corresponding criteria from the criteria_set index is met, (contained within quotation marks. For example, CriteriaResults("Cyclist", "Potential"), "na"). |
percent |
Write a number between 0 and 1. For example, 0.6. |
row |
Click a row number from the grid. |
value |
Select a cell containing a numeric value. |
value_set |
Select a set of values by clicking cells that contain numeric values. |
() |
Some functions end with empty brackets (like numberOfColumns, numberOfRows, and numberOfCells). The brackets should be left as they are. |
Example: Dynamic Text based on a Dynamic Function
In the following example, we want to configure dynamic text that show the average cost for Accessories, in a currency format with no decimal places.
The first step is to add the average function from the queries drop down:
Next, highlight the average function and select Currency ($#) from the formats drop down. The average function will be inserted into the format function:
Next, remove [<value_set>] and replace it with the set of values for which the average should be returned. To do this, simply click the relevant cells (blue highlight), and separate each of them with a comma: